package otherBefore.month11;

/**
 * @author sps
 * @date 2023/5/8 18:35
 */
public class leet0508 {
    public static void main(String[] args) {
        Horse wh = new WhiteHorse();
        Horse bh = new BlackHorse();
        Mozi mozi = new Mozi();
        wh.eat();
        bh.eat();
    }
}

class Horse {
    public void eat(){
        System.out.println("马吃草");
    }
}

class WhiteHorse extends Horse {
    public void eat(){
        System.out.println("1马吃草");
    }
}
class BlackHorse extends Horse {
    public void eat(){
        System.out.println("2马吃草");
    }
}
class Mozi {

    public void ride(Horse h) {
        System.out.println("骑马");
    }

    public void ride(WhiteHorse wh) {
        System.out.println("骑白马");
    }

    public void ride(BlackHorse bh) {
        System.out.println("骑黑马");
    }

}